<?php
/**
 * 
 * Model Generica
 * @author Ramon Moraes
 *
 */
class Generica extends DataMapper {
    
    function __construct(){
        
    	parent::DataMapper();
    }
    
	public function get($limit = NULL, $offset = NULL){
		
		if($this->hasDeleteLogico){
			$this->where('flag', 'ATIVO');
		}
		
		parent::get($limit, $offset);
	}
	
	public function delete($object = NULL){
		
		if($this->hasDeleteLogico){
			$this->flag = 'INATIVO';
			$this->save();
		}else{
			parent::delete($object);
		}
	}
	
	/*
	public function count(){
		
		if($this->hasDeleteLogico){
			$this->where('flag', 'ATIVO');
		}
		
		parent::count();
	}
	*/
}

/* End of file generica.php */
/* Location: ./application/libraries/generica.php */
?>